From ad2c8b83e801340d21cca006d66879e90fc7ced6 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 14 Aug 2007 16:01:08 +0100 Subject: [PATCH] [xen, xencomm] xencomm trivial bug fix - fix return address of xencomm_copy_to_guest() - fix xencomm_add_offset() Signed-off-by: Isaku Yamahata --- xen/common/xencomm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/xencomm.c b/xen/common/xencomm.c index 8b7e502869..3ee5d00c25 100644 --- a/xen/common/xencomm.c +++ b/xen/common/xencomm.c @@ -232,7 +232,7 @@ xencomm_copy_to_guest(void *to, const void *from, unsigned int n, dest_maddr = paddr_to_maddr(dest_paddr + chunk_skip); if (dest_maddr == 0) - return -1; + return n - from_pos; if (xencomm_debug) printk("%lx[%d] -> %lx\n", source, bytes, dest_maddr); @@ -280,6 +280,11 @@ int xencomm_add_offset(void **handle, unsigned int bytes) unsigned int chunksz; unsigned int chunk_skip; + if (dest_paddr == XENCOMM_INVALID) { + i++; + continue; + } + pgoffset = dest_paddr % PAGE_SIZE; chunksz = PAGE_SIZE - pgoffset; @@ -291,6 +296,8 @@ int xencomm_add_offset(void **handle, unsigned int bytes) desc->address[i] += chunk_skip; } bytes -= chunk_skip; + + i++; } return 0; } -- 2.30.2